import request from '@/utils/request'

export default {
  //获取用户List
  getUserList(current, limit, userQuery) {
    return request({
      url: `/intern/user/list/${current}/${limit}`,
      method: 'post',
      //userQuery条件对象，后端使用RequestBody获取数据
      //data表示把对象转换json进行传递到接口里面
      data: userQuery
    })
  },
  //根据ID删除用户
  deleteUserId(id) {
      return request({
          url: `/intern/user/delete/${id}`,
          method: 'delete'
      })
  },
  //添加用户
  addUser(user) {
      return request({
          url: `/intern/user/register`,
          method: 'post',
          data: user
      })
  },
  //修改用户
  updateUserInfo(user) {
      return request({
          url: `/intern/user/updateUser`,
          method: 'post',
          data: user
      })
  },
  //获取用户信息
  getUserInfo(id) {
      return request({
          url: `/intern/user/getUser/${id}`,
          method: 'get'
      })
  }

}
